You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > MtxIntDiff Class > MtxIntDiff Methods > MtxIntDiff.Romberg Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
MtxIntDiff.Romberg Method

Numerical integration by using recursive Romberg algorithm.

Syntax
C#
Visual Basic
public static double Romberg(TRealFunction Fun, double lb, double ub, [In] TMtxFloatPrecision FloatPrecision, [In] TVec Constants, [In] object[] ObjConst, out TIntStopReason StopReason, double Tolerance, int MaxIter);
Parameters 
Description 
TRealFunction Fun 
Integrating function. 
double lb 
Defines lower bound. 
double ub 
Defines upper bound. 
[In] TMtxFloatPrecision FloatPrecision 
Defines the computational precision to be used by the routine. 
[In] TVec Constants 
Additional constants defining Fun function, usually nil/null. 
[In] object[] ObjConst 
Additional objects defining Fun function, usually nil/null. 
out TIntStopReason StopReason 
Returns algorithm stop reason. 
double Tolerance 
Defines integration tolerance. 
int MaxIter 
Defines maximum number of alorithm iterations. 

the numerical approximate on integral of function Fun between limits lb and ub.

Evaluate fuction Sin(x)*Exp(-x^2) on interval [0,PI/2] by using Romberg algorithm. 

 

private double IntFun(TVec x, TVec c, params object[] o) { double x = x[0]; return System.Math.Sin(x)*System.Math.Exp(-x*x); } private void Example() { TIntStopReason sr; double area = MtxIntDif.Romberg(IntFun,0.0,5*System.Math.PI,out sr, 1.0e-4, 100); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!